package com.primal.quartz.support;

import com.primal.util.AsyncManager;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * Author whh
 * Date 2023/10/11/ 19:56
 * <p></p>
 */
public abstract class JobSupport implements Job {

    public abstract void doExecute(JobExecutionContext jobExecutionContext);

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        doExecute(jobExecutionContext);
        AsyncManager.me().setDelay(1).submit(() -> {
            System.out.println("记录日志:"+Thread.currentThread().getName());
        });
    }
}
